package com.jr.service.impl;

import com.jr.entry.User;
import com.jr.mapper.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements com.jr.service.UserService {
     @Autowired
     UserMapper userMapper;
    public boolean register(User user) {
        return userMapper.insertUser(user)==0? false:true;
    }

    public User login(User user) {
        return userMapper.selectByUsernameAndPassword(user);
    }

    public boolean updatePassword(User user) { return userMapper.updateUser(user)==0? false:true; }

    public boolean selectUser(User user) {
        return userMapper.selectUser(user)==null?false:true;
    }
}
